<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/6/006
 * Time: 10:37
 */

namespace app\api\validate;


class OrderValidate extends BaseValidate {
    protected $rule = [
        'status' => 'isPositiveInteger',
        'comment_status' => 'isPositiveInteger',
        'pattern_master_id' => 'isPositiveInteger',
        'num' => 'isPositiveInteger',
        'attr_group_id' => 'isPositiveInteger',
        'address_id' => 'isPositiveInteger',
        'source' => 'require|in:android,ios',
        'model' => 'require|in:order,order_buy,order_recharge',
        'money' => 'isPositiveInteger'
    ];

    protected $scene = [
        'status'  =>  ['status'],
        'comment_status'  =>  ['comment_status'],
        'pattern_master_id'  =>  ['pattern_master_id'],
        'num'  =>  ['num'],
        'attr_group_id'  =>  ['attr_group_id'],
        'create_order'  =>  ['address_id', 'source'],
        'pay'  =>  ['model'],
        'recharge' => ['source', 'money']
    ];
}